Optimal. Leaf size=280 \[ \frac {x \sqrt {a+c x^2} \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^2}+\frac {a \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^{5/2}}-\frac {\left (a+c x^2\right )^{3/2} \left (8 \left (2 a h^2 (e h+2 f g)+c g \left (f g^2-2 h (5 d h+e g)\right )\right )-3 h x \left (5 h^2 (2 c d-a f)-2 c g (f g-2 e h)\right )\right )}{120 c^2 h}-\frac {\left (a+c x^2\right )^{3/2} (g+h x)^2 (f g-2 e h)}{10 c h}+\frac {f \left (a+c x^2\right )^{3/2} (g+h x)^3}{6 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.50, antiderivative size = 279, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {1654, 833, 780, 195, 217, 206} \[ \frac {x \sqrt {a+c x^2} \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^2}+\frac {a \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^{5/2}}-\frac {\left (a+c x^2\right )^{3/2} \left (8 \left (2 a h^2 (e h+2 f g)-2 c g h (5 d h+e g)+c f g^3\right )-3 h x \left (5 h^2 (2 c d-a f)-2 c g (f g-2 e h)\right )\right )}{120 c^2 h}-\frac {\left (a+c x^2\right )^{3/2} (g+h x)^2 (f g-2 e h)}{10 c h}+\frac {f \left (a+c x^2\right )^{3/2} (g+h x)^3}{6 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 195
Rule 206
Rule 217
Rule 780
Rule 833
Rule 1654
Rubi steps
\begin {align*} \int (g+h x)^2 \sqrt {a+c x^2} \left (d+e x+f x^2\right ) \, dx &=\frac {f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}+\frac {\int (g+h x)^2 \left (3 (2 c d-a f) h^2-3 c h (f g-2 e h) x\right ) \sqrt {a+c x^2} \, dx}{6 c h^2}\\ &=-\frac {(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac {f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}+\frac {\int (g+h x) \left (3 c h^2 (10 c d g-3 a f g-4 a e h)+3 c h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \sqrt {a+c x^2} \, dx}{30 c^2 h^2}\\ &=-\frac {(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac {f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac {\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac {\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) \int \sqrt {a+c x^2} \, dx}{8 c^2}\\ &=\frac {\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) x \sqrt {a+c x^2}}{16 c^2}-\frac {(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac {f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac {\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac {\left (a \left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right )\right ) \int \frac {1}{\sqrt {a+c x^2}} \, dx}{16 c^2}\\ &=\frac {\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) x \sqrt {a+c x^2}}{16 c^2}-\frac {(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac {f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac {\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac {\left (a \left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1-c x^2} \, dx,x,\frac {x}{\sqrt {a+c x^2}}\right )}{16 c^2}\\ &=\frac {\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) x \sqrt {a+c x^2}}{16 c^2}-\frac {(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac {f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac {\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac {a \left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{16 c^{5/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.65, size = 256, normalized size = 0.91 \[ \frac {\sqrt {a+c x^2} \left (\sqrt {c} \left (a^2 (-h) (32 e h+64 f g+15 f h x)+2 a c \left (5 d h (16 g+3 h x)+e \left (40 g^2+30 g h x+8 h^2 x^2\right )+f x \left (15 g^2+16 g h x+5 h^2 x^2\right )\right )+4 c^2 x \left (5 d \left (6 g^2+8 g h x+3 h^2 x^2\right )+x \left (2 e \left (10 g^2+15 g h x+6 h^2 x^2\right )+f x \left (15 g^2+24 g h x+10 h^2 x^2\right )\right )\right )\right )+\frac {15 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{\sqrt {\frac {c x^2}{a}+1}}\right )}{240 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.05, size = 595, normalized size = 2.12 \[ \left [-\frac {15 \, {\left (4 \, a^{2} c e g h - 2 \, {\left (4 \, a c^{2} d - a^{2} c f\right )} g^{2} + {\left (2 \, a^{2} c d - a^{3} f\right )} h^{2}\right )} \sqrt {c} \log \left (-2 \, c x^{2} - 2 \, \sqrt {c x^{2} + a} \sqrt {c} x - a\right ) - 2 \, {\left (40 \, c^{3} f h^{2} x^{5} + 80 \, a c^{2} e g^{2} - 32 \, a^{2} c e h^{2} + 48 \, {\left (2 \, c^{3} f g h + c^{3} e h^{2}\right )} x^{4} + 10 \, {\left (6 \, c^{3} f g^{2} + 12 \, c^{3} e g h + {\left (6 \, c^{3} d + a c^{2} f\right )} h^{2}\right )} x^{3} + 32 \, {\left (5 \, a c^{2} d - 2 \, a^{2} c f\right )} g h + 16 \, {\left (5 \, c^{3} e g^{2} + a c^{2} e h^{2} + 2 \, {\left (5 \, c^{3} d + a c^{2} f\right )} g h\right )} x^{2} + 15 \, {\left (4 \, a c^{2} e g h + 2 \, {\left (4 \, c^{3} d + a c^{2} f\right )} g^{2} + {\left (2 \, a c^{2} d - a^{2} c f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + a}}{480 \, c^{3}}, \frac {15 \, {\left (4 \, a^{2} c e g h - 2 \, {\left (4 \, a c^{2} d - a^{2} c f\right )} g^{2} + {\left (2 \, a^{2} c d - a^{3} f\right )} h^{2}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{\sqrt {c x^{2} + a}}\right ) + {\left (40 \, c^{3} f h^{2} x^{5} + 80 \, a c^{2} e g^{2} - 32 \, a^{2} c e h^{2} + 48 \, {\left (2 \, c^{3} f g h + c^{3} e h^{2}\right )} x^{4} + 10 \, {\left (6 \, c^{3} f g^{2} + 12 \, c^{3} e g h + {\left (6 \, c^{3} d + a c^{2} f\right )} h^{2}\right )} x^{3} + 32 \, {\left (5 \, a c^{2} d - 2 \, a^{2} c f\right )} g h + 16 \, {\left (5 \, c^{3} e g^{2} + a c^{2} e h^{2} + 2 \, {\left (5 \, c^{3} d + a c^{2} f\right )} g h\right )} x^{2} + 15 \, {\left (4 \, a c^{2} e g h + 2 \, {\left (4 \, c^{3} d + a c^{2} f\right )} g^{2} + {\left (2 \, a c^{2} d - a^{2} c f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + a}}{240 \, c^{3}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.21, size = 321, normalized size = 1.15 \[ \frac {1}{240} \, \sqrt {c x^{2} + a} {\left ({\left (2 \, {\left ({\left (4 \, {\left (5 \, f h^{2} x + \frac {6 \, {\left (2 \, c^{4} f g h + c^{4} h^{2} e\right )}}{c^{4}}\right )} x + \frac {5 \, {\left (6 \, c^{4} f g^{2} + 6 \, c^{4} d h^{2} + a c^{3} f h^{2} + 12 \, c^{4} g h e\right )}}{c^{4}}\right )} x + \frac {8 \, {\left (10 \, c^{4} d g h + 2 \, a c^{3} f g h + 5 \, c^{4} g^{2} e + a c^{3} h^{2} e\right )}}{c^{4}}\right )} x + \frac {15 \, {\left (8 \, c^{4} d g^{2} + 2 \, a c^{3} f g^{2} + 2 \, a c^{3} d h^{2} - a^{2} c^{2} f h^{2} + 4 \, a c^{3} g h e\right )}}{c^{4}}\right )} x + \frac {16 \, {\left (10 \, a c^{3} d g h - 4 \, a^{2} c^{2} f g h + 5 \, a c^{3} g^{2} e - 2 \, a^{2} c^{2} h^{2} e\right )}}{c^{4}}\right )} - \frac {{\left (8 \, a c^{2} d g^{2} - 2 \, a^{2} c f g^{2} - 2 \, a^{2} c d h^{2} + a^{3} f h^{2} - 4 \, a^{2} c g h e\right )} \log \left ({\left | -\sqrt {c} x + \sqrt {c x^{2} + a} \right |}\right )}{16 \, c^{\frac {5}{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 446, normalized size = 1.59 \[ \frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} f \,h^{2} x^{3}}{6 c}+\frac {a^{3} f \,h^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{16 c^{\frac {5}{2}}}-\frac {a^{2} d \,h^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{8 c^{\frac {3}{2}}}-\frac {a^{2} e g h \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{4 c^{\frac {3}{2}}}-\frac {a^{2} f \,g^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{8 c^{\frac {3}{2}}}+\frac {a d \,g^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{2 \sqrt {c}}+\frac {\sqrt {c \,x^{2}+a}\, a^{2} f \,h^{2} x}{16 c^{2}}-\frac {\sqrt {c \,x^{2}+a}\, a d \,h^{2} x}{8 c}-\frac {\sqrt {c \,x^{2}+a}\, a e g h x}{4 c}-\frac {\sqrt {c \,x^{2}+a}\, a f \,g^{2} x}{8 c}+\frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} e \,h^{2} x^{2}}{5 c}+\frac {2 \left (c \,x^{2}+a \right )^{\frac {3}{2}} f g h \,x^{2}}{5 c}+\frac {\sqrt {c \,x^{2}+a}\, d \,g^{2} x}{2}-\frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} a f \,h^{2} x}{8 c^{2}}+\frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} d \,h^{2} x}{4 c}+\frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} e g h x}{2 c}+\frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} f \,g^{2} x}{4 c}-\frac {2 \left (c \,x^{2}+a \right )^{\frac {3}{2}} a e \,h^{2}}{15 c^{2}}-\frac {4 \left (c \,x^{2}+a \right )^{\frac {3}{2}} a f g h}{15 c^{2}}+\frac {2 \left (c \,x^{2}+a \right )^{\frac {3}{2}} d g h}{3 c}+\frac {\left (c \,x^{2}+a \right )^{\frac {3}{2}} e \,g^{2}}{3 c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.46, size = 305, normalized size = 1.09 \[ \frac {{\left (c x^{2} + a\right )}^{\frac {3}{2}} f h^{2} x^{3}}{6 \, c} + \frac {1}{2} \, \sqrt {c x^{2} + a} d g^{2} x - \frac {{\left (c x^{2} + a\right )}^{\frac {3}{2}} a f h^{2} x}{8 \, c^{2}} + \frac {\sqrt {c x^{2} + a} a^{2} f h^{2} x}{16 \, c^{2}} + \frac {a d g^{2} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{2 \, \sqrt {c}} + \frac {a^{3} f h^{2} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{16 \, c^{\frac {5}{2}}} + \frac {{\left (c x^{2} + a\right )}^{\frac {3}{2}} e g^{2}}{3 \, c} + \frac {2 \, {\left (c x^{2} + a\right )}^{\frac {3}{2}} d g h}{3 \, c} + \frac {{\left (2 \, f g h + e h^{2}\right )} {\left (c x^{2} + a\right )}^{\frac {3}{2}} x^{2}}{5 \, c} + \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} {\left (c x^{2} + a\right )}^{\frac {3}{2}} x}{4 \, c} - \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} \sqrt {c x^{2} + a} a x}{8 \, c} - \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} a^{2} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{8 \, c^{\frac {3}{2}}} - \frac {2 \, {\left (2 \, f g h + e h^{2}\right )} {\left (c x^{2} + a\right )}^{\frac {3}{2}} a}{15 \, c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (g+h\,x\right )}^2\,\sqrt {c\,x^2+a}\,\left (f\,x^2+e\,x+d\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 21.00, size = 738, normalized size = 2.64 \[ - \frac {a^{\frac {5}{2}} f h^{2} x}{16 c^{2} \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {a^{\frac {3}{2}} d h^{2} x}{8 c \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {a^{\frac {3}{2}} e g h x}{4 c \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {a^{\frac {3}{2}} f g^{2} x}{8 c \sqrt {1 + \frac {c x^{2}}{a}}} - \frac {a^{\frac {3}{2}} f h^{2} x^{3}}{48 c \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {\sqrt {a} d g^{2} x \sqrt {1 + \frac {c x^{2}}{a}}}{2} + \frac {3 \sqrt {a} d h^{2} x^{3}}{8 \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {3 \sqrt {a} e g h x^{3}}{4 \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {3 \sqrt {a} f g^{2} x^{3}}{8 \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {5 \sqrt {a} f h^{2} x^{5}}{24 \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {a^{3} f h^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{16 c^{\frac {5}{2}}} - \frac {a^{2} d h^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{8 c^{\frac {3}{2}}} - \frac {a^{2} e g h \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{4 c^{\frac {3}{2}}} - \frac {a^{2} f g^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{8 c^{\frac {3}{2}}} + \frac {a d g^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{2 \sqrt {c}} + 2 d g h \left (\begin {cases} \frac {\sqrt {a} x^{2}}{2} & \text {for}\: c = 0 \\\frac {\left (a + c x^{2}\right )^{\frac {3}{2}}}{3 c} & \text {otherwise} \end {cases}\right ) + e g^{2} \left (\begin {cases} \frac {\sqrt {a} x^{2}}{2} & \text {for}\: c = 0 \\\frac {\left (a + c x^{2}\right )^{\frac {3}{2}}}{3 c} & \text {otherwise} \end {cases}\right ) + e h^{2} \left (\begin {cases} - \frac {2 a^{2} \sqrt {a + c x^{2}}}{15 c^{2}} + \frac {a x^{2} \sqrt {a + c x^{2}}}{15 c} + \frac {x^{4} \sqrt {a + c x^{2}}}{5} & \text {for}\: c \neq 0 \\\frac {\sqrt {a} x^{4}}{4} & \text {otherwise} \end {cases}\right ) + 2 f g h \left (\begin {cases} - \frac {2 a^{2} \sqrt {a + c x^{2}}}{15 c^{2}} + \frac {a x^{2} \sqrt {a + c x^{2}}}{15 c} + \frac {x^{4} \sqrt {a + c x^{2}}}{5} & \text {for}\: c \neq 0 \\\frac {\sqrt {a} x^{4}}{4} & \text {otherwise} \end {cases}\right ) + \frac {c d h^{2} x^{5}}{4 \sqrt {a} \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {c e g h x^{5}}{2 \sqrt {a} \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {c f g^{2} x^{5}}{4 \sqrt {a} \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {c f h^{2} x^{7}}{6 \sqrt {a} \sqrt {1 + \frac {c x^{2}}{a}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________